#
# @lc app=leetcode.cn id=2559 lang=python3
#
# [2559] 统计范围内的元音字符串数
#

# @lc code=start
from itertools import accumulate
from typing import List


class Solution:
    def vowelStrings(self, words: List[str], queries: List[List[int]]) -> List[int]:
        s = list(accumulate((w[0] in 'aeiou' and w[-1] in 'aeiou' for w in words),initial=0))
        return [s[r+1] - s[l] for l,r in queries]
# @lc code=end

